{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Q# notebooks #\n",
    "\n",
    "This notebook will show you how to use IQ# to write your own quantum application notebooks.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Compiling Q# operations"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "An operation is the basic unit of quantum execution in Q#. It is roughly equivalent to a function in C or C++ or Python, or a static method in C# or Java.\n",
    "\n",
    "IQ#, the Q# Jupyter kernel, allows you to write Q# operations directly on a code cell and compile them by running the cell (pressing  Ctrl/⌘+Enter). For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "[\"SayHello\"]",
      "text/html": [
       "<ul><li>SayHello</li></ul>"
      ],
      "text/plain": [
       "SayHello"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "operation SayHello(name: String) : Unit {\n",
    "\n",
    "    // The following line will simply write a message to the console:\n",
    "    Message($\"Hello {name}!\");\n",
    "\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "When you **Run** the cell, Q# compiles the code and returns the name of the operations it found. \n",
    "In this case, it found only one operation (`SayHello`). \n",
    "\n",
    "If the compiler detects any errors, it will instead show the list of errors in the output. For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\snippet_.qs(5,5): error QS5022: No identifier with the name \"FooBar\" exists.\n",
      "C:\\snippet_.qs(9,12): error QS6211: Unexpected argument tuple. Expecting an argument of type String.\n"
     ]
    }
   ],
   "source": [
    "operation InvalidQ() : Unit {\n",
    "\n",
    "    // The `FooBar` operation doesn't exist, so the following line\n",
    "    // will generate a `No variable with that name exists.` error:\n",
    "    FooBar(\"Hello again!\");\n",
    "    \n",
    "    // `Message` takes only one string argument, so the following line\n",
    "    // will generate a `Unexpected argument tuple.` error:\n",
    "    Message(1, 2);\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Q# operations can call other operations previously defined; they can also call all the operations defined in the \n",
    "[Microsoft.Quantum.Intrinsic](https://docs.microsoft.com/qsharp/api/qsharp/microsoft.quantum.intrinsic) and \n",
    "[Microsoft.Quantum.Canon](https://docs.microsoft.com/qsharp/api/qsharp/microsoft.quantum.canon) namespaces (like [Message](https://docs.microsoft.com/qsharp/api/qsharp/microsoft.quantum.intrinsic.message)).\n",
    "\n",
    "For example, you can create a new operation that calls the previously compiled `SayHello`:\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "[\"HelloAndres\"]",
      "text/html": [
       "<ul><li>HelloAndres</li></ul>"
      ],
      "text/plain": [
       "HelloAndres"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "operation HelloAndres() : Unit {\n",
    "    SayHello(\"Andres\");\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "They can also use all [Q# standard library](https://docs.microsoft.com/qsharp/api/) operations defined in other namespaces by importing the namespace using the `open` statement. For example, to use [`PI`](https://docs.microsoft.com/qsharp/api/prelude/microsoft.quantum.math.pi) you would need to open the ` Microsoft.Quantum.Math` namespace; optionally you can call the operation providing its fully qualified name, for example:\n",
    " "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "[\"HelloPi\"]",
      "text/html": [
       "<ul><li>HelloPi</li></ul>"
      ],
      "text/plain": [
       "HelloPi"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "open Microsoft.Quantum.Math;\n",
    "\n",
    "operation HelloPi() : Unit {\n",
    "    let pi = Microsoft.Quantum.Convert.DoubleAsString(PI());\n",
    "    SayHello(pi);\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "You can define multiple operations in a single cell and use any valid Q# code, for example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "[\"SetPlus\",\"SetMinus\",\"PrepareRandomMessage\"]",
      "text/html": [
       "<ul><li>SetPlus</li><li>SetMinus</li><li>PrepareRandomMessage</li></ul>"
      ],
      "text/plain": [
       "SetPlus, SetMinus, PrepareRandomMessage"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "open Microsoft.Quantum.Random;\n",
    "\n",
    "/// # Summary\n",
    "/// Sets the qubit's state to |+⟩\n",
    "operation SetPlus(q: Qubit) : Unit {\n",
    "    Reset(q);\n",
    "    H(q);\n",
    "}\n",
    "\n",
    "/// # Summary\n",
    "/// Sets the qubit's state to |-⟩\n",
    "operation SetMinus(q: Qubit) : Unit {\n",
    "    Reset(q);\n",
    "    X(q);\n",
    "    H(q);\n",
    "}\n",
    "\n",
    "/// # Summary\n",
    "/// Randomly prepares the qubit into |+⟩ or |-⟩\n",
    "operation PrepareRandomMessage(q: Qubit) : Unit {\n",
    "\n",
    "    let choice = DrawRandomInt(0, 1);\n",
    "\n",
    "    if choice == 0 {\n",
    "        Message(\"Prepared |-⟩\");\n",
    "        SetMinus(q);\n",
    "    } else {\n",
    "        Message(\"Prepared |+⟩\");\n",
    "        SetPlus(q);\n",
    "    }\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "and create other operations that uses them:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "[\"SampleRandomBit\",\"TestPrepareQubits\"]",
      "text/html": [
       "<ul><li>SampleRandomBit</li><li>TestPrepareQubits</li></ul>"
      ],
      "text/plain": [
       "SampleRandomBit, TestPrepareQubits"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "open Microsoft.Quantum.Diagnostics;\n",
    "open Microsoft.Quantum.Measurement;\n",
    "\n",
    "operation SampleRandomBit() : Result {\n",
    "    use q = Qubit();\n",
    "    SetPlus(q);\n",
    "    return MResetZ(q);\n",
    "}\n",
    "\n",
    "operation TestPrepareQubits() : Result {\n",
    "    mutable r = Zero;\n",
    "    \n",
    "    use qubits = Qubit[5];\n",
    "    ApplyToEach(PrepareRandomMessage, qubits);\n",
    "    DumpMachine();\n",
    "\n",
    "    set r = Measure([PauliX, PauliX, PauliX, PauliX, PauliX], qubits);\n",
    "\n",
    "    ResetAll(qubits);\n",
    "    \n",
    "    return r;\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Simulating Q# operations\n",
    "\n",
    "\n",
    "Once a Q# operation has been successfully compiled, you can use the `%simulate` command to simulate it. For example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello 3.141592653589793!\r\n"
     ]
    },
    {
     "data": {
      "application/json": "{\"@type\":\"tuple\"}",
      "text/plain": [
       "()"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%simulate HelloPi"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%simulate SampleRandomBit"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "`%simulate` will print any console output on the notebook, and it will return the operation's return value. If the operation returns `Unit` it prints `()`, otherwise it prints the actual value.\n",
    "\n",
    "`%simulate` only accepts operations that take no arguments. If you want to call an operation that accepts parameters, like `SayHello`, create a wrapper operation that calls it with the corresponding values, like `HelloPi`.\n",
    "\n",
    "As mentioned, all messages are printed on the notebook; this includes calls to [`DumpMachine`](https://docs.microsoft.com/qsharp/api/prelude/microsoft.quantum.extensions.diagnostics.dumpmachine):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "\"\\\"bitstring\\\"\"",
      "text/plain": [
       "\"bitstring\""
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%config dump.basisStateLabelingConvention = \"bitstring\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Prepared |+⟩\n",
      "Prepared |+⟩\n",
      "Prepared |-⟩\n",
      "Prepared |+⟩\n",
      "Prepared |+⟩\n"
     ]
    },
    {
     "data": {
      "application/json": "{\"div_id\":\"dump-machine-div-c4bb378c-046e-4056-8e6d-9f5fdb5d1d13\",\"qubit_ids\":[0,1,2,3,4],\"n_qubits\":5,\"amplitudes\":[{\"Real\":0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":0.0},{\"Real\":0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":0.0},{\"Real\":0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":0.0},{\"Real\":0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":0.0},{\"Real\":-0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":3.141592653589793},{\"Real\":-0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":3.141592653589793},{\"Real\":-0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":3.141592653589793},{\"Real\":-0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":3.141592653589793},{\"Real\":0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":0.0},{\"Real\":0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":0.0},{\"Real\":0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":0.0},{\"Real\":0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":0.0},{\"Real\":-0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":3.141592653589793},{\"Real\":-0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":3.141592653589793},{\"Real\":-0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":3.141592653589793},{\"Real\":-0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":3.141592653589793},{\"Real\":0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":0.0},{\"Real\":0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":0.0},{\"Real\":0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":0.0},{\"Real\":0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":0.0},{\"Real\":-0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":3.141592653589793},{\"Real\":-0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":3.141592653589793},{\"Real\":-0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":3.141592653589793},{\"Real\":-0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":3.141592653589793},{\"Real\":0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":0.0},{\"Real\":0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":0.0},{\"Real\":0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":0.0},{\"Real\":0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":0.0},{\"Real\":-0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":3.141592653589793},{\"Real\":-0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":3.141592653589793},{\"Real\":-0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":3.141592653589793},{\"Real\":-0.17677669529663692,\"Imaginary\":0.0,\"Magnitude\":0.17677669529663692,\"Phase\":3.141592653589793}]}",
      "text/html": [
       "\r\n",
       "                    <table style=\"table-layout: fixed; width: 100%\">\r\n",
       "                        <thead>\r\n",
       "                            \r\n",
       "                        <tr>\r\n",
       "                            <th>Qubit IDs</th>\r\n",
       "                            <td span=\"3\">0, 1, 2, 3, 4</td>\r\n",
       "                        </tr>\r\n",
       "                    \r\n",
       "                            <tr>\r\n",
       "                                <th style=\"width: 20ch)\">Basis state (bitstring)</th>\r\n",
       "                                <th style=\"width: 20ch\">Amplitude</th><th style=\"width: calc(100% - 26ch - 20ch)\">Meas. Pr.</th><th style=\"width: 6ch\">Phase</th>\r\n",
       "                            </tr>\r\n",
       "                        </thead>\r\n",
       "                        <tbody>\r\n",
       "                        \r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|00000\\right\\rangle$</td>\r\n",
       "                                <td>$0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-1d9a4bf6-4e2b-49f5-abcd-6c9c95dfa612\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-1d9a4bf6-4e2b-49f5-abcd-6c9c95dfa612\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|00001\\right\\rangle$</td>\r\n",
       "                                <td>$0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-f13e0bcb-cd45-4be0-ac2e-66344df89b80\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-f13e0bcb-cd45-4be0-ac2e-66344df89b80\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|00010\\right\\rangle$</td>\r\n",
       "                                <td>$0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-0fa43684-ac4b-40cb-b3ca-d0c83acc752d\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-0fa43684-ac4b-40cb-b3ca-d0c83acc752d\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|00011\\right\\rangle$</td>\r\n",
       "                                <td>$0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-f7a19142-4d61-4664-9f94-1fc2d183c49d\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-f7a19142-4d61-4664-9f94-1fc2d183c49d\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|00100\\right\\rangle$</td>\r\n",
       "                                <td>$-0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-3befcc80-2a3a-43ec-9c43-443cf4e067ec\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-3befcc80-2a3a-43ec-9c43-443cf4e067ec\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(180deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|00101\\right\\rangle$</td>\r\n",
       "                                <td>$-0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-b4724f02-21fb-44eb-88bf-465a959a9684\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-b4724f02-21fb-44eb-88bf-465a959a9684\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(180deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|00110\\right\\rangle$</td>\r\n",
       "                                <td>$-0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-a1a85823-c68d-4162-a88c-ddb29539066c\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-a1a85823-c68d-4162-a88c-ddb29539066c\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(180deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|00111\\right\\rangle$</td>\r\n",
       "                                <td>$-0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-053973b5-4228-419a-84dc-228ac929d9a0\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-053973b5-4228-419a-84dc-228ac929d9a0\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(180deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|01000\\right\\rangle$</td>\r\n",
       "                                <td>$0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-a4e2829c-f258-40be-bd2c-a661ffb5feb1\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-a4e2829c-f258-40be-bd2c-a661ffb5feb1\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|01001\\right\\rangle$</td>\r\n",
       "                                <td>$0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-1f176cfc-c418-4f72-adc8-e85dc4681385\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-1f176cfc-c418-4f72-adc8-e85dc4681385\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|01010\\right\\rangle$</td>\r\n",
       "                                <td>$0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-3271862c-459e-4838-a917-8d1776f3ff01\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-3271862c-459e-4838-a917-8d1776f3ff01\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|01011\\right\\rangle$</td>\r\n",
       "                                <td>$0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-56b4907f-9258-48ce-8cf1-dece15fbb01c\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-56b4907f-9258-48ce-8cf1-dece15fbb01c\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|01100\\right\\rangle$</td>\r\n",
       "                                <td>$-0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-62a2ead5-a09d-4f86-837e-569796d1734e\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-62a2ead5-a09d-4f86-837e-569796d1734e\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(180deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|01101\\right\\rangle$</td>\r\n",
       "                                <td>$-0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-3b7d3681-100d-4096-ade0-86543bbe5fd3\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-3b7d3681-100d-4096-ade0-86543bbe5fd3\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(180deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|01110\\right\\rangle$</td>\r\n",
       "                                <td>$-0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-630f0866-f1c5-4677-b653-b8b82b05f933\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-630f0866-f1c5-4677-b653-b8b82b05f933\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(180deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|01111\\right\\rangle$</td>\r\n",
       "                                <td>$-0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-004470f2-634e-4d82-ac03-b3c953f8122d\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-004470f2-634e-4d82-ac03-b3c953f8122d\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(180deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|10000\\right\\rangle$</td>\r\n",
       "                                <td>$0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-6fc081a6-5204-4eaa-bbb3-6073d387da3f\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-6fc081a6-5204-4eaa-bbb3-6073d387da3f\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|10001\\right\\rangle$</td>\r\n",
       "                                <td>$0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-135e77ab-bf4d-4118-8ffe-435f8b7c1c3d\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-135e77ab-bf4d-4118-8ffe-435f8b7c1c3d\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|10010\\right\\rangle$</td>\r\n",
       "                                <td>$0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-71d243e2-0b8b-463b-b006-4c7a6272729f\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-71d243e2-0b8b-463b-b006-4c7a6272729f\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|10011\\right\\rangle$</td>\r\n",
       "                                <td>$0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-c5531ecb-fa36-4458-b4a0-3829fef53589\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-c5531ecb-fa36-4458-b4a0-3829fef53589\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|10100\\right\\rangle$</td>\r\n",
       "                                <td>$-0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-daf12820-0445-4307-b18e-c14d2151c5ee\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-daf12820-0445-4307-b18e-c14d2151c5ee\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(180deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|10101\\right\\rangle$</td>\r\n",
       "                                <td>$-0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-e63afba7-5d28-424a-a267-d74cae330bfb\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-e63afba7-5d28-424a-a267-d74cae330bfb\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(180deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|10110\\right\\rangle$</td>\r\n",
       "                                <td>$-0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-b1a6c715-195b-46b5-8062-956d60420c67\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-b1a6c715-195b-46b5-8062-956d60420c67\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(180deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|10111\\right\\rangle$</td>\r\n",
       "                                <td>$-0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-890c31db-be3f-40e3-b79f-2dd920ca17e9\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-890c31db-be3f-40e3-b79f-2dd920ca17e9\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(180deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|11000\\right\\rangle$</td>\r\n",
       "                                <td>$0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-4e431da9-dac5-4959-b374-cc714e9d5ffb\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-4e431da9-dac5-4959-b374-cc714e9d5ffb\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|11001\\right\\rangle$</td>\r\n",
       "                                <td>$0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-99ae3410-cb41-4cf9-b9f6-dac16643c2fe\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-99ae3410-cb41-4cf9-b9f6-dac16643c2fe\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|11010\\right\\rangle$</td>\r\n",
       "                                <td>$0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-5af84f7a-5b8d-493d-888d-97d25163d349\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-5af84f7a-5b8d-493d-888d-97d25163d349\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|11011\\right\\rangle$</td>\r\n",
       "                                <td>$0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-498bd817-0961-4adf-9343-ae1c7277e100\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-498bd817-0961-4adf-9343-ae1c7277e100\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(0deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|11100\\right\\rangle$</td>\r\n",
       "                                <td>$-0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-50a83d14-09ec-4fdc-bf86-9e19c0cc6dd7\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-50a83d14-09ec-4fdc-bf86-9e19c0cc6dd7\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(180deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|11101\\right\\rangle$</td>\r\n",
       "                                <td>$-0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-51b7513a-6e11-4415-8d61-f684af8fc33b\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-51b7513a-6e11-4415-8d61-f684af8fc33b\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(180deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|11110\\right\\rangle$</td>\r\n",
       "                                <td>$-0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-0f51bcca-087d-4577-8cc5-6aef91c34ba6\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-0f51bcca-087d-4577-8cc5-6aef91c34ba6\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(180deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \n",
       "\r\n",
       "                            <tr>\r\n",
       "                                <td>$\\left|11111\\right\\rangle$</td>\r\n",
       "                                <td>$-0.1768 + 0.0000 i$</td>\r\n",
       "                                \r\n",
       "                                <td>\r\n",
       "                                    <progress\r\n",
       "                                        max=\"100\"\r\n",
       "                                        value=\"3.1250000000000013\"\r\n",
       "                                        style=\"width: 100%;\"\r\n",
       "                                    > \r\n",
       "                                    <td>\r\n",
       "                                    <p id=\"round-799e2132-ba3d-4209-8c20-197652f14894\"> \r\n",
       "                                    <script>\r\n",
       "                                    var num = 3.1250000000000013;\r\n",
       "                                    num = num.toFixed(4);\r\n",
       "                                    var num_string = num + \"%\";\r\n",
       "                                     document.getElementById(\"round-799e2132-ba3d-4209-8c20-197652f14894\").innerHTML = num_string;\r\n",
       "                                    </script> </p>\r\n",
       "                                    </td>\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                                \r\n",
       "                                <td style=\"transform: rotate(180deg);\r\n",
       "                   text-align: center;\">\r\n",
       "                                 ↑\r\n",
       "                                </td>\r\n",
       "                            \r\n",
       "                            </tr>\r\n",
       "                        \r\n",
       "                        </tbody>\r\n",
       "                    </table>"
      ],
      "text/plain": [
       "|00000⟩\t0.17677669529663692 + 0𝑖\n",
       "|00001⟩\t0.17677669529663692 + 0𝑖\n",
       "|00010⟩\t0.17677669529663692 + 0𝑖\n",
       "|00011⟩\t0.17677669529663692 + 0𝑖\n",
       "|00100⟩\t-0.17677669529663692 + 0𝑖\n",
       "|00101⟩\t-0.17677669529663692 + 0𝑖\n",
       "|00110⟩\t-0.17677669529663692 + 0𝑖\n",
       "|00111⟩\t-0.17677669529663692 + 0𝑖\n",
       "|01000⟩\t0.17677669529663692 + 0𝑖\n",
       "|01001⟩\t0.17677669529663692 + 0𝑖\n",
       "|01010⟩\t0.17677669529663692 + 0𝑖\n",
       "|01011⟩\t0.17677669529663692 + 0𝑖\n",
       "|01100⟩\t-0.17677669529663692 + 0𝑖\n",
       "|01101⟩\t-0.17677669529663692 + 0𝑖\n",
       "|01110⟩\t-0.17677669529663692 + 0𝑖\n",
       "|01111⟩\t-0.17677669529663692 + 0𝑖\n",
       "|10000⟩\t0.17677669529663692 + 0𝑖\n",
       "|10001⟩\t0.17677669529663692 + 0𝑖\n",
       "|10010⟩\t0.17677669529663692 + 0𝑖\n",
       "|10011⟩\t0.17677669529663692 + 0𝑖\n",
       "|10100⟩\t-0.17677669529663692 + 0𝑖\n",
       "|10101⟩\t-0.17677669529663692 + 0𝑖\n",
       "|10110⟩\t-0.17677669529663692 + 0𝑖\n",
       "|10111⟩\t-0.17677669529663692 + 0𝑖\n",
       "|11000⟩\t0.17677669529663692 + 0𝑖\n",
       "|11001⟩\t0.17677669529663692 + 0𝑖\n",
       "|11010⟩\t0.17677669529663692 + 0𝑖\n",
       "|11011⟩\t0.17677669529663692 + 0𝑖\n",
       "|11100⟩\t-0.17677669529663692 + 0𝑖\n",
       "|11101⟩\t-0.17677669529663692 + 0𝑖\n",
       "|11110⟩\t-0.17677669529663692 + 0𝑖\n",
       "|11111⟩\t-0.17677669529663692 + 0𝑖"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/json": "1",
      "text/plain": [
       "One"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%simulate TestPrepareQubits"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## The Workspace\n",
    "\n",
    "The notebook uses the folder it lives on disk to define a workspace. It will try to compile all the Q# files (i.e. all files with a `.qs` extension) it finds under the current folder and will make the operations it finds available to operations in the notebook. For example, the [Operations.qs](/Operations.qs) file in this folder defines two operations:\n",
    "* Microsoft.Quantum.Samples.IsMinus\n",
    "* Microsoft.Quantum.Samples.IsPlus\n",
    "\n",
    "To get the list of operations defined in the workspace, you can use the `%workspace` command:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "[\"Microsoft.Quantum.Samples.IsMinus\",\"Microsoft.Quantum.Samples.IsPlus\"]",
      "text/html": [
       "<ul><li>Microsoft.Quantum.Samples.IsMinus</li><li>Microsoft.Quantum.Samples.IsPlus</li></ul>"
      ],
      "text/plain": [
       "Microsoft.Quantum.Samples.IsMinus, Microsoft.Quantum.Samples.IsPlus"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%workspace"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "These operations can be used in this notebook, for example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "[\"CheckPlus\"]",
      "text/html": [
       "<ul><li>CheckPlus</li></ul>"
      ],
      "text/plain": [
       "CheckPlus"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "open Microsoft.Quantum.Samples;\n",
    "\n",
    "operation CheckPlus() : Bool {\n",
    "    mutable result = false;\n",
    "    \n",
    "    use q = Qubit();\n",
    "    SetPlus(q);\n",
    "    set result = IsPlus(q);\n",
    "\n",
    "    Reset(q);\n",
    "\n",
    "    return result;\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "true",
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%simulate CheckPlus"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To pick up any changes you make to a Q# file in the workspace, use `%workspace reload`. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "{\"LastUpdated\":\"2021-01-28T14:06:38.3173033-08:00\",\"IsCompleted\":true,\"Description\":\"Reloading workspace\",\"Subtask\":\"done\"}",
      "text/plain": [
       "Reloading workspace: done!"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/json": "[\"Microsoft.Quantum.Samples.IsMinus\",\"Microsoft.Quantum.Samples.IsPlus\"]",
      "text/html": [
       "<ul><li>Microsoft.Quantum.Samples.IsMinus</li><li>Microsoft.Quantum.Samples.IsPlus</li></ul>"
      ],
      "text/plain": [
       "Microsoft.Quantum.Samples.IsMinus, Microsoft.Quantum.Samples.IsPlus"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%workspace reload"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Getting Help ##\n",
    "\n",
    "Q# supports adding documentation to operations via comments in the code. When such documentation exists, you can access it from the notebook by adding a question mark before or after the operation name on a code cell, for example:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "{\"name\":\"Microsoft.Quantum.Intrinsic.X\",\"kind\":3,\"source\":\"C:\\\\Users\\\\cgran\\\\.dotnet\\\\tools\\\\.store\\\\microsoft.quantum.iqsharp\\\\0.15.2101125897\\\\microsoft.quantum.iqsharp\\\\0.15.2101125897\\\\tools\\\\netcoreapp3.1\\\\any\\\\Microsoft.Quantum.QSharp.Core.dll\",\"documentation\":\" # Summary\\n Applies the Pauli $X$ gate.\\n\\n \\\\begin{align}\\n     \\\\sigma_x \\\\mathrel{:=}\\n     \\\\begin{bmatrix}\\n         0 & 1 \\\\\\\\\\\\\\\\\\n         1 & 0\\n     \\\\end{bmatrix}.\\n \\\\end{align}\\n\\n # Input\\n ## qubit\\n Qubit to which the gate should be applied.\",\"summary\":\"Applies the Pauli $X$ gate.\\r\\r\\\\begin{align}\\r\\\\sigma_x \\\\mathrel{:=}\\r\\\\begin{bmatrix}\\r0 & 1 \\\\\\\\\\\\\\\\\\r1 & 0\\r\\\\end{bmatrix}.\\r\\\\end{align}\",\"inputs\":{\"qubit\":\"Qubit to which the gate should be applied.\"}}",
      "text/html": [
       "\r\n",
       "                    <h4><i class=\"fa fas fa-terminal\"></i> Microsoft.Quantum.Intrinsic.X <a href=\"C:\\Users\\cgran\\.dotnet\\tools\\.store\\microsoft.quantum.iqsharp\\0.15.2101125897\\microsoft.quantum.iqsharp\\0.15.2101125897\\tools\\netcoreapp3.1\\any\\Microsoft.Quantum.QSharp.Core.dll\"><i class=\"fa fas fa-code\"></i></a></h4>\r\n",
       "                    <h5>Summary</h5><p>Applies the Pauli $X$ gate.</p>\n",
       "<p>\\begin{align}\n",
       "\\sigma_x \\mathrel{:=}\n",
       "\\begin{bmatrix}\n",
       "0 &amp; 1 \\\\\n",
       "1 &amp; 0\n",
       "\\end{bmatrix}.\n",
       "\\end{align}</p>\n",
       "\r\n",
       "                    \r\n",
       "                "
      ],
      "text/plain": [
       "Microsoft.Quantum.Intrinsic.X"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Microsoft.Quantum.Intrinsic.X?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This documentation is available for any operations in the Prelude, Canon and Workspace, or even those defined locally in the notebook:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "{\"name\":\"PrepareRandomMessage\",\"kind\":3,\"source\":\"C:\\\\Users\\\\cgran\\\\source\\\\repos\\\\microsoft\\\\quantum\\\\samples\\\\getting-started\\\\intro-to-iqsharp\\\\obj\\\\__snippets__.dll\",\"documentation\":\" # Summary\\n Randomly prepares the qubit into |+⟩ or |-⟩\",\"inputs\":{}}",
      "text/html": [
       "\r\n",
       "                    <h4><i class=\"fa fas fa-terminal\"></i> PrepareRandomMessage <a href=\"C:\\Users\\cgran\\source\\repos\\microsoft\\quantum\\samples\\getting-started\\intro-to-iqsharp\\obj\\__snippets__.dll\"><i class=\"fa fas fa-code\"></i></a></h4>\r\n",
       "                    \r\n",
       "                    \r\n",
       "                "
      ],
      "text/plain": [
       "PrepareRandomMessage"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PrepareRandomMessage?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Other commands ##"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### `%who`\n",
    "\n",
    "`%who` returns the list of all local and workspace operations available."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "[\"CheckPlus\",\"HelloAndres\",\"HelloPi\",\"Microsoft.Quantum.Samples.IsMinus\",\"Microsoft.Quantum.Samples.IsPlus\",\"PrepareRandomMessage\",\"SampleRandomBit\",\"SayHello\",\"SetMinus\",\"SetPlus\",\"TestPrepareQubits\"]",
      "text/html": [
       "<ul><li>CheckPlus</li><li>HelloAndres</li><li>HelloPi</li><li>Microsoft.Quantum.Samples.IsMinus</li><li>Microsoft.Quantum.Samples.IsPlus</li><li>PrepareRandomMessage</li><li>SampleRandomBit</li><li>SayHello</li><li>SetMinus</li><li>SetPlus</li><li>TestPrepareQubits</li></ul>"
      ],
      "text/plain": [
       "CheckPlus, HelloAndres, HelloPi, Microsoft.Quantum.Samples.IsMinus, Microsoft.Quantum.Samples.IsPlus, PrepareRandomMessage, SampleRandomBit, SayHello, SetMinus, SetPlus, TestPrepareQubits"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%who"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### `%package`\n",
    "\n",
    "`%package` allows you to load nuget packages and makes available any Q# operations defined on them. For example, to use the operations from [Q#'s Quantum Chemistry Library](https://docs.microsoft.com/azure/quantum/user-guide/libraries/chemistry), you must load the [Microsoft.Quantum.Chemistry](https://www.nuget.org/packages/Microsoft.Quantum.Chemistry/) nuget package:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "{\"LastUpdated\":\"2021-01-28T14:06:47.2677329-08:00\",\"IsCompleted\":true,\"Description\":\"Adding package Microsoft.Quantum.Chemistry\",\"Subtask\":\"done\"}",
      "text/plain": [
       "Adding package Microsoft.Quantum.Chemistry: done!"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/json": "[\"Microsoft.Quantum.Standard::0.15.2101125897\",\"Microsoft.Quantum.Standard.Visualization::0.15.2101125897\",\"Microsoft.Quantum.Chemistry::0.15.2101125897\"]",
      "text/html": [
       "<ul><li>Microsoft.Quantum.Standard::0.15.2101125897</li><li>Microsoft.Quantum.Standard.Visualization::0.15.2101125897</li><li>Microsoft.Quantum.Chemistry::0.15.2101125897</li></ul>"
      ],
      "text/plain": [
       "Microsoft.Quantum.Standard::0.15.2101125897, Microsoft.Quantum.Standard.Visualization::0.15.2101125897, Microsoft.Quantum.Chemistry::0.15.2101125897"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%package Microsoft.Quantum.Chemistry"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "`%package` returns the list of nuget packages currently loaded and their version."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### `%project`\n",
    "\n",
    "`%project` allows you to load Q# projects from folders outside the current workspace and makes available any Q# operations defined in them. For example, to use the operations from the [quantum random number generator sample](https://github.com/microsoft/Quantum/tree/rmshaffer/project-reference-samples/samples/getting-started/qrng), you may add a reference to the `.csproj` file in that folder:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Adding reference to project: ../qrng/Qrng.csproj\r\n"
     ]
    },
    {
     "data": {
      "application/json": "{\"LastUpdated\":\"2021-01-28T14:06:54.1743029-08:00\",\"IsCompleted\":true,\"Description\":\"Reloading workspace\",\"Subtask\":\"done\"}",
      "text/plain": [
       "Reloading workspace: done!"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/json": "[\"C:\\\\Users\\\\cgran\\\\source\\\\repos\\\\microsoft\\\\quantum\\\\samples\\\\getting-started\\\\qrng\\\\Qrng.csproj\"]",
      "text/html": [
       "<ul><li>C:\\Users\\cgran\\source\\repos\\microsoft\\quantum\\samples\\getting-started\\qrng\\Qrng.csproj</li></ul>"
      ],
      "text/plain": [
       "C:\\Users\\cgran\\source\\repos\\microsoft\\quantum\\samples\\getting-started\\qrng\\Qrng.csproj"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%project ../qrng/Qrng.csproj"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "`%project` returns the list of Q# projects currently loaded."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### `%version`\n",
    "\n",
    "`%version` simply returns the current versions of IQ# and of Jupyter Core (a library used by IQ#):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/json": "{\"rows\":[{\"@type\":\"@tuple\",\"Item1\":\"iqsharp\",\"Item2\":\"0.15.2101125897\"},{\"@type\":\"@tuple\",\"Item1\":\"Jupyter Core\",\"Item2\":\"1.5.0.0\"},{\"@type\":\"@tuple\",\"Item1\":\".NET Runtime\",\"Item2\":\".NETCoreApp,Version=v3.1\"}]}",
      "text/html": [
       "<table><thead><tr><th style=\"text-align: start;\">Component</th><th style=\"text-align: start;\">Version</th></tr></thead><tbody><tr><td style=\"text-align: start;\">iqsharp</td><td style=\"text-align: start;\">0.15.2101125897</td></tr><tr><td style=\"text-align: start;\">Jupyter Core</td><td style=\"text-align: start;\">1.5.0.0</td></tr><tr><td style=\"text-align: start;\">.NET Runtime</td><td style=\"text-align: start;\">.NETCoreApp,Version=v3.1</td></tr></tbody></table>"
      ],
      "text/plain": [
       "Component    Version\r\n",
       "------------ ------------------------\r\n",
       "iqsharp      0.15.2101125897\r\n",
       "Jupyter Core 1.5.0.0\r\n",
       ".NET Runtime .NETCoreApp,Version=v3.1\r\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%version"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Q#",
   "language": "qsharp",
   "name": "iqsharp"
  },
  "language_info": {
   "file_extension": ".qs",
   "mimetype": "text/x-qsharp",
   "name": "qsharp",
   "version": "0.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
